1. Field of the Invention
The present invention relates to digital filters and more particularly to a sub-band decoder having a reduced memory size and a method of performing an inverse discrete cosine transform that generates time domain samples from frequency domain samples using a limited number of prestored cosine coefficients.
2. Description of Related Art
Audio and video files, before being compressed, typically consist of 16 bit samples recorded at a sampling rate more than twice the actual audio bandwidth (e.g., 44.1 kHz for Compact Disks), which yields more than 1.4 Mbit to represent just one second of stereo music in CD quality. Since such vast amounts of data are unwieldy, data compression is required.
MPEG (Motion Picture Experts Group) provides standards for compressing digital audio and video signals. MP3 (MPEG Layer 3) is the MPEG layer 3 audio standard. Using MPEG audio coding, the original sound data can be reduced by a factor of 12, without sacrificing sound quality. Audio data in an MPEG compatible data stream is commonly referred to as the audio sub-band. According to MPEG standards, the audio sub-band contains sets of 32 code values that are frequency domain samples Sk. Decoding 32 frequency domain samples Sk, where k is a frequency index and ranges from 0 to 31, generates 64 time domain sound samples Vi, where i is a time index and ranges from 0 to 63. Recently MP3 audio files have become very popular and as a result, MP3 has become the de facto standard for storing audio files, with many MP3 files available on the Internet and many programs that support the MP3 standard.
FIG. 1 is a schematic block diagram of a conventional MP3 decoder 10. The decoder 10 receives an encoded MP3 bit stream and converts it to an analog audio output signal that is a single PCM coded signal that sounds identical to the original audio signal. More specifically, the MP3 bit stream is a sequence of many frames, each containing a header, error checking bits, miscellaneous information, and encoded data.
At block 12, the MP3 bit stream is received and upon detection of a sync-word indicating the start of a frame, the decoder 10 identifies the header and side information. Next, at block 14, the decoder 10 obtains scale factors. Then, the decoder 10 must decode the samples, which are coded using Huffman codes, at block 16. Huffman coding can pack audio data very efficiently. Further, Huffman coding is lossless because no noise is added to the audio signal.
After a bit pattern is decoded, it is dequantized at block 18 using a non-linear dequantization equation, and at block 20, reorder, anti-alias and stereo processing are performed on the samples. Next, at block 22, an Inverse Modified Discrete Cosine Transform (IMDCT) is performed on the frequency domain samples. Finally, at block 24, sub-band synthesis is performed to transform the frequency domain sub-band sample back to a time domain PCM audio signal. The sub-band synthesis is the most computation intensive part of the signal processing, typically taking more than half of the total decoding time.
Sub-band synthesis has two main parts, an IDCT (Inverse Discrete Cosine Transform) process that generates time domain samples from frequency domain samples and a windowing process that generates the final PCM output signal. More particularly, the IDCT process generates 64 samples (Vi) from 32 input sub-band samples (Sk). Using direct matrix processing, for i=0 to 63,                               V          i                =                              ∑                          k              =              0                        31                    ⁢                                    cos              ⁡                              (                                                      (                                          π                      /                      64                                        )                                    ⁢                                      (                                          i                      +                      16                                        )                                    ⁢                                      (                                                                  2                        ⁢                        k                                            +                      1                                        )                                                  )                                      ×                          S              k                                                          (        1        )            requires about 2,000 additions and about 2,000 multiplications to be performed.
In addition, when the decoder 10 is implemented with a DSP, MCU, microprocessor or dedicated hardware that processes data in real-time, the cosine coefficients must be obtained quickly. One conventional method of obtaining the cosine coefficients is to calculate them directly using an estimation method or by calling a library cosine function. Each calculation/estimation of cos requires greater than 60 cycles.
Referring to FIG. 2, a second conventional method is to store the coefficients in a 32×64 array. FIG. 2 shows a 32×64 matrix of cosine coefficients, where C=cos((π/64)(i+16) (2k+1)). Assuming each coefficient is stored in a 32 bit memory space, then 8 k bytes of memory are required (32×64×4 bytes/word=8192 bytes).
Yet another known method of obtaining the cosine coefficients is to extract and store only certain, symmetric ones of the coefficients, as disclosed in U.S. Pat. No. 6,094,637. According to this patent, the 32×64 matrix is reduced to 16×32, which requires that only 496 coefficients be stored. However, storing 496 coefficients still requires 1984 bytes of memory (496×4 bytes/word=1984).
While large tables are readily formed without concern for the amount of memory used by decoders such as in MP3 players implemented on personal computers, with the increase in the popularity of MP3 files for storing music, there has been a corresponding increase in the demand for miniature stand-alone MP3 devices and other, small portable devices such as mobile telephones and personal digital assistants (PDAs) capable of playing MP3 encoded music. It would be beneficial if this memory requirement could be further reduced for such portable devices without requiring a large corresponding increase in computational requirements.